/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.giftmemo.ui.utils;

import com.alee.laf.rootpane.WebDialog;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFrame;

/**
 *
 * @author Egor
 */
public class BasicDialog extends WebDialog{

    public BasicDialog() {
        init();
    }
    
    public BasicDialog(JFrame owner) {
        super(owner);
        init();
    }
    
    private void init(){
        setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
        
    }
    
    public void setContent(JComponent... components){
        for (int i = 0; i < components.length; i++) {
            JComponent jComponent = components[i];
            getContentPane().add(jComponent);
        }
        
        pack();
    }
    
    
    public void showDialog(){
        setVisible(true);
    }
    
    public void hideDialog(){
        setVisible(false);
    }
}
